<?php

/**
 * Cliente filter form base class.
 *
 * @package    zing
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseClienteFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'razonSocial'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'cuitCuil'     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'tipoIva'      => new sfWidgetFormChoice(array('choices' => array('' => '', 'Inscripto' => 'Inscripto', 'No Inscripto' => 'No Inscripto', 'Monotributista' => 'Monotributista', 'Responsable Inscripto' => 'Responsable Inscripto', 'Consumidor Final' => 'Consumidor Final'))),
      'direccion'    => new sfWidgetFormFilterInput(),
      'ciudad'       => new sfWidgetFormFilterInput(),
      'codigoPostal' => new sfWidgetFormFilterInput(),
      'pais'         => new sfWidgetFormFilterInput(),
      'telefono'     => new sfWidgetFormFilterInput(),
      'celular'      => new sfWidgetFormFilterInput(),
      'email'        => new sfWidgetFormFilterInput(),
      'created_at'   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'   => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'razonSocial'  => new sfValidatorPass(array('required' => false)),
      'cuitCuil'     => new sfValidatorPass(array('required' => false)),
      'tipoIva'      => new sfValidatorChoice(array('required' => false, 'choices' => array('Inscripto' => 'Inscripto', 'No Inscripto' => 'No Inscripto', 'Monotributista' => 'Monotributista', 'Responsable Inscripto' => 'Responsable Inscripto', 'Consumidor Final' => 'Consumidor Final'))),
      'direccion'    => new sfValidatorPass(array('required' => false)),
      'ciudad'       => new sfValidatorPass(array('required' => false)),
      'codigoPostal' => new sfValidatorPass(array('required' => false)),
      'pais'         => new sfValidatorPass(array('required' => false)),
      'telefono'     => new sfValidatorPass(array('required' => false)),
      'celular'      => new sfValidatorPass(array('required' => false)),
      'email'        => new sfValidatorPass(array('required' => false)),
      'created_at'   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'   => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('cliente_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Cliente';
  }

  public function getFields()
  {
    return array(
      'id'           => 'Number',
      'razonSocial'  => 'Text',
      'cuitCuil'     => 'Text',
      'tipoIva'      => 'Enum',
      'direccion'    => 'Text',
      'ciudad'       => 'Text',
      'codigoPostal' => 'Text',
      'pais'         => 'Text',
      'telefono'     => 'Text',
      'celular'      => 'Text',
      'email'        => 'Text',
      'created_at'   => 'Date',
      'updated_at'   => 'Date',
    );
  }
}
